package org.spring.qq_chat_java.pojo;


import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import org.apache.ibatis.type.EnumOrdinalTypeHandler;
import org.spring.qq_chat_java.constant.ReceiverType;
import org.spring.qq_chat_java.constant.message.messageStatus;
import org.spring.qq_chat_java.constant.message.messageType;

import java.time.LocalDateTime;


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("message")
public class Message {
    @TableId(type = IdType.AUTO)
    private Long messageId;
    private Long senderId;
    private Long receiverId;
    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private ReceiverType receiverType;    // 接收者类型
    private String content;               // 消息内容
    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private messageType type ;            //  消息类型

    @TableField(typeHandler = EnumOrdinalTypeHandler.class)
    private messageStatus status;         // 消息状态
    private LocalDateTime sentTime;      //  发送时间
}
